package com.itheima.demo02;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class MainDemo06 {
    public static void main(String[] args) {
        String s = "2020-01-13 12:13:15";
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        LocalDateTime parse = LocalDateTime.parse(s, dateTimeFormatter);
        System.out.println(parse);

        LocalDateTime localDateTime = LocalDateTime.of(2020,10,23,12,13,14);
        String format = dateTimeFormatter.format(localDateTime);
        System.out.println(format);
    }
}
